package com.itheima.excel;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;

import java.io.File;

public class EasyExcelDemo {
    public static void main(String[] args) {
        EasyExcel.read(new File("D:\\work\\sz152\\下发资料\\web\\【扩展】excel导入导出\\资料\\03. excel文件\\用户信息.xlsx"),
                ExcelUser.class,new ReadListener<ExcelUser>() {
                    // 每读取一行记录时调用一次
                    @Override
                    public void invoke(ExcelUser excelUser, AnalysisContext analysisContext) {
                        System.out.println(excelUser);
                    }

                    // 全部内容读取完后调用
                    @Override
                    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
                        System.out.println("全部解析完成");
                    }
                }).sheet().doRead();
    }
}
